<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue.js基本概念</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <style>
        .selected {
            background-color: #eee;
            width: 300px;
            border-radius: 5px;
            padding: 2rem;

        }

    </style>
</head>

<body>
    <h1>Vue.js基本概念</h1>
    <h2>列表渲染</h2>
    <div id="app">
        <table border="1">
            <tr>
                <th>地点</th>
                <th>等级</th>
            </tr>
            <tr v-for="item in epidemic" v-bind:key="item.id">
                <td>{{ item.city }}</td>
                <td>{{ item.responseLevel }}</td>
            </tr>
        </table>
        <p v-for="item in epidemic" v-bind:key="item.id">地点：{{ item.city }}等级：{{ item.responseLevel }}</p>
        <div v-bind:style="{ color: activeColor, fontSize: fontSize + 'px' }">
            道冲而用之或不盈，渊兮似万物之宗。挫其锐，解其纷，和其光，同其尘。湛兮似或存，吾不知谁之子，象帝之先。</div>
        <div :style="styleObject" :class="classObject">
            道冲而用之或不盈，渊兮似万物之宗。挫其锐，解其纷，和其光，同其尘。湛兮似或存，吾不知谁之子，象帝之先。</div>
    </div>
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                epidemic: [
                    { id: 1, city: '兰州', responseLevel: 4 },
                    { id: 2, city: '武汉', responseLevel: 3 },
                    { id: 3, city: '舒兰', responseLevel: 1 },
                    { id: 4, city: '北京', responseLevel: 4 },
                ],
                bgc: "#eee",
                status: 'selected',
                activeColor: 'red',
                fontSize: 18,
                styleObject: {
                    color: 'green',
                    fontSize: '18px'
                },
                classObject: {
                    actived: true,
                    info: false
                }
            },
        });
    </script>

</body>

</html>
